var assert = require('assert');
var should = require('should');
var util = require('util');
var _ = require('lodash');
var copyModel = require('../../app/models/copyModel');
var buildType = require('../../app/consts/buildType');
var config = require('../config');

suite('测试copyModel', function () {
    var copy_model;
    setup(function (done) {
        copyModel.getByRoleId(config.role_id, function (err, model) {
            assert.equal(err == null, true);
            copy_model = model;
            copy_model.toJSON();
            done();
        });
    });

    suite('getCopy', function () {
        test('获取副本数据', function () {

            copy_model.passCopy(10105, 3);
            copy_model.passCopy(10106, 3);
            copy_model.passCopy(10104, 3);
            copy_model.passCopy(10103, 3);
            copy_model.passCopy(10102, 3);
            copy_model.passCopy(10101, 3);

            copy_model.passCopy(10205, 3);
            copy_model.passCopy(10206, 3);
            copy_model.passCopy(10204, 3);
            copy_model.passCopy(10203, 3);
            copy_model.passCopy(10202, 3);
            copy_model.passCopy(10201, 3);

            copy_model.passCopy(10305, 3);
            copy_model.passCopy(10306, 3);
            copy_model.passCopy(10304, 3);
            copy_model.passCopy(10303, 3);
            copy_model.passCopy(10302, 3);
            copy_model.passCopy(10301, 3);

            copy_model.passCopy(10405, 3);
            copy_model.passCopy(10406, 3);
            copy_model.passCopy(10404, 3);
            copy_model.passCopy(10403, 3);
            copy_model.passCopy(10402, 3);
            copy_model.passCopy(10401, 3);

            copy_model.passCopy(10505, 3);
            copy_model.passCopy(10506, 3);
            copy_model.passCopy(10504, 3);
            copy_model.passCopy(10503, 3);
            copy_model.passCopy(10502, 3);
            copy_model.passCopy(10501, 3);

            copy_model.passCopy(10605, 3);
            copy_model.passCopy(10606, 3);
            copy_model.passCopy(10604, 3);
            copy_model.passCopy(10603, 3);
            copy_model.passCopy(10602, 3);
            copy_model.passCopy(10601, 3);

            copy_model.passCopy(10705, 3);
            copy_model.passCopy(10706, 3);
            copy_model.passCopy(10704, 3);
            copy_model.passCopy(10703, 3);
            copy_model.passCopy(10702, 3);
            copy_model.passCopy(10701, 3);
            copy_model.save();
        });
    });

    //suite('getCopy', function () {
    //test('通关副本', function (done) {
    //copy_model.passCopy(1000);
    //copy_model.passCopy(1000, 1);
    //copy_model.getCopy(1000);
    //copy_model.getLastChange();
    //copy_model.pushModify();
    //copy_model.save(done);
    //});
    //});

    //suite('addDoubleCopyExpNum', function () {
    //test('增加双倍副本道具卡使用次数', function (done) {
    //copy_model.addDoubleCopyExpNum(10);
    //copy_model.pushModify();
    //copy_model.save(done);
    //});
    //});

    //suite('subDoubleCopyExpNum', function () {
    //test('扣除双倍副本道具卡使用次数', function (done) {
    //copy_model.subDoubleCopyExpNum();
    //copy_model.pushModify();
    //copy_model.save(done);
    //});
    //});

    suite('重置黑市', function () {
        test('重置黑市', function (done) {
            copy_model.resBlackmarketList();
            copy_model.save(done);
            console.log('black_market_list:', copy_model.black_market_list);
        });
    });
});
